package site.yunnong.atvris.portal.spider.v191;

import com.geccocrawler.gecco.GeccoEngine;
import com.geccocrawler.gecco.annotation.Gecco;
import com.geccocrawler.gecco.annotation.HtmlField;
import com.geccocrawler.gecco.request.HttpGetRequest;
import com.geccocrawler.gecco.spider.HtmlBean;
import lombok.Data;

import java.util.List;

/**
 * @author zjh
 * @date 2021/8/28 16:28
 */
@Data
@Gecco(matchUrl = "https://v.191.cn/index/cate?page={page}&id=0&od=0&keywords=", pipelines = "v191PagePipeline")
public class V191Page implements HtmlBean {
    
    private static final long serialVersionUID = 1L;
    
    // video infos
    @HtmlField(cssPath = ".video-list")
    private List<VideoInfo> videoInfoList;


    public static void main(String[] args) {
        // 视频列表首页
        HttpGetRequest start = new HttpGetRequest("https://v.191.cn/index/cate?page=1&id=0&od=0&keywords=");
        GeccoEngine.create()
                .classpath("site.yunnong.atvris.portal.spider")
                .seed(start)
                .thread(1)
                .interval(2000)
                .start();
    }
}
